<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Test Report</title>
    <meta name="author" content="Oleksii Skliarov, Ivan Lysenko"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <style type="text/css" media="screen">
        body        { font-family: verdana, arial, helvetica, sans-serif; font-size: 80%; }
        table       { font-size: 100%; }
        pre         { }

        /* -- heading ---------------------------------------------------------------------- */
        h1 {
            font-size: 16pt;
            color: gray;
        }
        .heading {
            margin-top: 0ex;
            margin-bottom: 1ex;
        }

        .heading .attribute {
            margin-top: 1ex;
            margin-bottom: 0;
        }

        .heading .description {
            margin-top: 4ex;
            margin-bottom: 6ex;
        }

        /* -- css div popup ------------------------------------------------------------------------ */
        a.popup_link {
        }

        a.popup_link:hover {
            color: red;
        }

        .popup_window {
            display: none;
            position: relative;
            left: 0px;
            top: 0px;
            /*border: solid #627173 1px; */
            padding: 8px;
            background-color: #E6E6D6;
            font-family: "Lucida Console", "Courier New", Courier, monospace;
            text-align: left;
            font-size: 8pt;
            width: 570px;
        }

        }
        /* -- report ------------------------------------------------------------------------ */
        #show_detail_line {
            margin-top: 3ex;
            margin-bottom: 1ex;
        }
        .result_table {
            width: 80%;
            border-collapse: collapse;
            border: 1px solid #777;
        }
        #header_row {
            font-weight: bold;
            color: white;
            background-color: #777;
        }
        .result_table td {
            border: 1px solid #777;
            padding: 2px;
        }
        .shortDescription {
            font-style: italic;
            font-weight: normal;
        }
        #total_row  { font-weight: bold; }
        .passClass  { background-color: #6c6; }
        .failClass  { background-color: #c60; }
        .errorClass { background-color: #c00; }
        .passCase   { color: #6c6; }
        .failCase   { color: #c60; font-weight: bold; }
        .errorCase  { color: #c00; font-weight: bold; }
        .hiddenRow  { display: none; }
        
        .testcase   { display: none; }
		.testclass.active ~ .testcase { display: table-row; }

        /* -- ending ---------------------------------------------------------------------- */
        #ending {
        }

    </style>
</head>
<body>
<script language="javascript" type="text/javascript">
output_list = Array();

/* level - 0:Summary; 1:Failed; 2:All */
function showCase(level) {
    trs = document.getElementsByClassName("testclass");
    for (var i = 0; i < trs.length; i++) {
        tr = trs[i];
        if(0==level && tr.className.indexOf("active") != -1){
			tr.className = tr.className.replace("active", "").replace("  ", " ").trim();
		}else if (2 == level && tr.className.indexOf("active") == -1){
			tr.className+=" active";
		}else if (1 == level){
			if(tr.className.indexOf("passClass") != -1){
				if(tr.className.indexOf("active") != -1){
					tr.className = tr.className.replace("active", "").replace("  ", " ").trim();
				}
			}else if (tr.className.indexOf("active") == -1){
				tr.className+=" active";
			}
        }
    }
}

function showClassDetail(element) {
    var currentClassValue = element.className || "";
      
    if (currentClassValue.indexOf("active") == -1) {
		currentClassValue += " active";
    } else {
		currentClassValue = currentClassValue.replace("active", "").replace("  ", " ");
	}
	element.className = currentClassValue.trim();
}


function showTestDetail(div_id){
    var details_div = document.getElementById(div_id)
    var displayState = details_div.style.display
    // alert(displayState)
    if (displayState != 'block' ) {
        displayState = 'block'
        details_div.style.display = 'block'
    }
    else {
        details_div.style.display = 'none'
    }
}

function togleClass(element, clas){
        var currentClassValue = element.className || "";

        if (currentClassValue.indexOf(clas) == -1) {
            currentClassValue += " "+clas;
        } else {
            currentClassValue = currentClassValue.replace(clas, "").replace("  ", " ");
        }
        element.className = currentClassValue.trim()
    }

function showRawLog(element){
        togleClass(element, "popup_window")
    }

function html_escape(s) {
    s = s.replace(/&/g,'&amp;');
    s = s.replace(/</g,'&lt;');
    s = s.replace(/>/g,'&gt;');
    return s;
}

</script>

<table>
    <tr id="header_row">
        <th>Class</th>
        <th>Fail</th>
        <th>Error</th>
        <th>Skip</th>
        <th>Success</th>
        <th>Total</th>
    </tr>
        <tr>
            <td>testcase.testNose1.testMycase</td>
            <td>0</td>
            <td>0</td>
            <td>0</td>
            <td>2</td>
            <td>2</td>
        </tr>
    <tr>
        <td><strong>Total</strong></td>
        <td>0</td>
        <td>0</td>
        <td>0</td>
        <td>2</td>
        <td>2</td>
    </tr>
</table>

<!-- test list -->
<!-- header -->
<p id='show_detail_line'>Show
<a href='javascript:showCase(0)'>Summary</a>
<a href='javascript:showCase(1)'>Failed</a>
<a href='javascript:showCase(2)'>All</a>
</p>
<table class='result_table'>
    <colgroup>
        <col align='left' width="50%" />
        <col align='right' width="10%"/>
        <col align='right' width="10%"/>
        <col align='right' width="10%"/>
        <col align='right' width="10%"/>
        <col align='right' width="10%"/>
    </colgroup>
    <tr id='header_row'>
        <td>Test Group/Test case</td>
        <td>Count</td>
        <td>Pass</td>
        <td>Fail</td>
        <td>Error</td>
        <td>View</td>
    </tr>
</table>    
<!-- for every test suite -->
    <table class='result_table'>
	    <colgroup>
            <col align='left' width="50%" />
            <col align='right' width="10%"/>
            <col align='right' width="10%"/>
            <col align='right' width="10%"/>
            <col align='right' width="10%"/>
            <col align='right' width="10%"/>
        </colgroup>
        <tr class='testclass passClass'>
            <td>testcase.testNose1.testMycase</td>
            <td>2</td>
            <td>2</td>
            <td>0</td>
            <td>0</td>
            <td><a href="javascript:void(0)" onclick="showClassDetail(this.parentNode.parentNode)">Detail</a></td>
        </tr>    
        <!-- for every test -->

<tr id='testcase.testNose1.testMycasetestGetUserStatus' class='testcase'>
            <td class="passCase">
                testGetUserStatus
            </td>
            <td>0:00:00.216150</td>
            <td colspan='4' align='center'>
            <!--css div popup start-->
            <a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_testcase.testNose1.testMycasetestGetUserStatus')" >
                Pass
            </a>

            <div id='div_testcase.testNose1.testMycasetestGetUserStatus' class="popup_window">
                <div style='text-align: right; color:red; cursor:pointer;'>
                <a onfocus='this.blur();' onclick="document.getElementById('div_testcase.testNose1.testMycasetestGetUserStatus').style.display = 'none' " >
                   [x]</a>
                </div>
                <pre>


                </pre>
            </div>
            <!--css div popup end-->

            </td>
        </tr>
<tr id='testcase.testNose1.testMycasetestPostUserStatus' class='testcase'>
            <td class="passCase">
                testPostUserStatus
            </td>
            <td>0:00:00.221481</td>
            <td colspan='4' align='center'>
            <!--css div popup start-->
            <a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_testcase.testNose1.testMycasetestPostUserStatus')" >
                Pass
            </a>

            <div id='div_testcase.testNose1.testMycasetestPostUserStatus' class="popup_window">
                <div style='text-align: right; color:red; cursor:pointer;'>
                <a onfocus='this.blur();' onclick="document.getElementById('div_testcase.testNose1.testMycasetestPostUserStatus').style.display = 'none' " >
                   [x]</a>
                </div>
                <pre>


                </pre>
            </div>
            <!--css div popup end-->

            </td>
        </tr></table>
    <table class='result_table'>
        <colgroup>
            <col align='left' width="50%"/>
            <col align='right' width="10%" id="results_count"/>
            <col align='right' width="10%" id="results_passed"/>
            <col align='right' width="10%" id="results_failed"/>
            <col align='right' width="10%" id="results_errors"/>
            <col align='right' width="10%"/>
        </colgroup>
        <!-- test list end -->
        <tr id='total_row'>
            <td>Total</td>
            <td>2</td>
            <td>2</td>
            <td>0</td>
            <td>0</td>
            <td>&nbsp;</td>
        </tr>
    </table>
    <br/>
    <a href="javascript:void(0)" onclick="showRawLog(document.getElementById('rawoutput'))">Full log raw output</a>
    <div id='rawoutput' class='popup_window'>
        <pre>/Users/u51/PycharmProjects/pythonproject/testdata
</pre>
    </div>
</body>
</html>